﻿using System;
using System.Web.UI.WebControls;

public partial class _Default : System.Web.UI.Page 
{
    protected void Page_Load(object sender, EventArgs e)
    {
        litError.Text = "";
    }
    protected void ProductDataSource_Updated(object sender, ObjectDataSourceStatusEventArgs e)
    {
        if (e.Exception != null)
        {
            litError.Text = e.Exception.Message;
            e.ExceptionHandled = true;
        }
        ProductDataSource.Inserted += new ObjectDataSourceStatusEventHandler(ProductDataSource_Inserted);
    }

    void  ProductDataSource_Inserted(object sender, ObjectDataSourceStatusEventArgs e)
    {
        var idOfNewEntity = e.ReturnValue;
    }
 
}
